
sorbital_ring = { # generic
	potential = { is_orbital_ring = yes }
	weight_modifier = { base = 10 }
	ai_design = {
		min = {
			base = 0
		}
		modules = {
			orbital_ring_habitation = {
				base = 20.00
				modifier = {
					factor = 2
					planet = {
						num_free_districts = { type = any value <= 2 }
					}
				}
			}

			orbital_ring_shipyard = {
				base = 0.0 # Generally better to use normal starbases for this
			}

			orbital_ring_anchorage = {
				base = 0.0 # Generally better to use normal starbases for this
			}

			orbital_ring_gun_battery = {
				base = 0.0
			}

			orbital_ring_missile_battery = {
				base = 0.0
			}

			orbital_ring_hangar_bay = {
				base = 0.0
			}
		}

		# token followed by priority
		buildings = {
			ring_synapse_hub = {
				base = 1.00
			}

			ring_maintenance_hub = {
				base = 1.00
			}
			
			### LV
			lv_ring_nurture_hub = {
				base = 1.00
			}
			### LV

			ring_bureaucracy_hub = {
				base = 1
				modifier = {
					add = 2
					planet = {
						OR = {
							has_unity_designation = yes
							has_building = building_sensorium_1
							has_building = building_autochthon_monument
							has_building = building_corporate_monument
							has_building = building_galactic_memorial_1
							has_building = building_simulation_1
						}
					}
				}
			}

			ring_minerals_hub = {
				base = 1
				modifier = {
					add = 2
					planet = {
						OR = {
							has_mining_designation = yes
							has_building = building_mineral_purification_plant
							has_building = building_mineral_purification_hub
						}
					}
				}
			}

			ring_energy_hub = {
				base = 1
				modifier = {
					add = 2
					planet = {
						OR = {
							has_generator_designation = yes
							has_building = building_energy_grid
							has_building = building_energy_nexus
						}
					}
				}
			}

			ring_food_hub = {
				base = 1
				modifier = {
					add = 2
					planet = {
						OR = {
							has_farming_designation = yes
							has_building = building_food_processing_facility
							has_building = building_food_processing_center
						}
					}
				}
			}

			ring_consumer_goods_hub = {
				base = 1
				modifier = {
					add = 2
					planet = {
						OR = {
							has_factory_designation = yes
							has_industrial_designation = yes
							has_building = building_factory_1
							has_building = building_factory_2
							has_building = building_factory_3
						}
					}
				}
			}

			ring_alloys_hub = {
				base = 1
				modifier = {
					add = 2
					planet = {
						OR = {
							has_foundry_designation = yes
							has_industrial_designation = yes
							has_building = building_foundry_1
							has_building = building_foundry_2
							has_building = building_foundry_3
						}
					}
				}
			}

			ring_trade_hub = {
				base = 1
				modifier = {
					add = 2
					planet = {
						OR = {
							has_trade_designation = yes
							has_building = building_galactic_stock_exchange
						}
					}
				}
			}
			
			### LV
			lv_ring_brothel_hub = {
				base = 1
				modifier = {
					add = 2
					planet = {
						OR = {
							has_trade_designation = yes
							has_building = building_galactic_stock_exchange
							has_building = building_lv_brothel
							has_building = building_lv_bordello
						}
					}
				}
			}
			### LV
		}
	}
}

sorbital_habitation = {
	potential = {
		is_orbital_ring = yes
		has_starbase_module = orbital_ring_habitation
	}

	weight_modifier = {
		base = 0
		complex_trigger_modifier = { # +75 for each habitation module
			trigger = count_starbase_modules
			parameters = {
				type = orbital_ring_habitation
			}
			mode = add
			mult = 75
		}
	}

	ai_design = {
		min = {
			base = 1
		}

		ratio = {
			base = 0.50
			modifier = {
				add = 0.25
				exists = owner
				owner = {
					is_pacifist = yes
				}
			}
		}

		# token followed by priority
		buildings = {
			ring_synapse_hub = {
				base = 1.00
			}

			ring_maintenance_hub = {
				base = 1.00
			}

			### LV
			lv_ring_nurture_hub = {
				base = 1.00
			}
			### LV

			ring_bureaucracy_hub = {
				base = 0
				modifier = {
					add = 3
					planet = {
						OR = {
							has_designation = col_bureau
							has_designation = col_bureau_spiritualist
							has_building = building_sensorium_1
							has_building = building_autochthon_monument
							has_building = building_corporate_monument
							has_building = building_galactic_memorial_1
							has_building = building_simulation_1
						}
					}
				}
			}

			ring_minerals_hub = {
				base = 0
				modifier = {
					add = 3
					planet = {
						OR = {
							has_designation = col_mining
							has_building = building_mineral_purification_plant
							has_building = building_mineral_purification_hub
						}
					}
				}
			}

			ring_energy_hub = {
				base = 0
				modifier = {
					add = 3
					planet = {
						OR = {
							has_designation = col_generator
							has_building = building_energy_grid
							has_building = building_energy_nexus
						}
					}
				}
			}

			ring_food_hub = {
				base = 0
				modifier = {
					add = 3
					planet = {
						OR = {
							has_designation = col_farming
							has_building = building_food_processing_facility
							has_building = building_food_processing_center
						}
					}
				}
			}

			ring_consumer_goods_hub = {
				base = 0
				modifier = {
					add = 3
					planet = {
						OR = {
							has_designation = col_industrial
							has_designation = col_factory
							has_building = building_factory_1
							has_building = building_factory_2
							has_building = building_factory_3
						}
					}
				}
			}

			ring_alloys_hub = {
				base = 0
				modifier = {
					add = 3
					planet = {
						OR = {
							has_designation = col_industrial
							has_designation = col_foundry
							has_building = building_foundry_1
							has_building = building_foundry_2
							has_building = building_foundry_3
						}
					}
				}
			}

			ring_trade_hub = {
				base = 1
				modifier = {
					add = 2
					planet = {
						OR = {
							has_designation = col_city
							has_building = building_galactic_stock_exchange
						}
					}
				}
			}
			
			### LV
			lv_ring_brothel_hub = {
				base = 1
				modifier = {
					add = 2
					planet = {
						OR = {
							has_designation = col_city
							has_building = building_galactic_stock_exchange
							has_building = building_lv_brothel
							has_building = building_lv_bordello
						}
					}
				}
			}
			### LV
		}

		modules = {
			orbital_ring_habitation = {
				base = 20.00
			}
		}
	}
}
